package com.pic;

import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

import com.digirun.android.base.BaseActivity;
import com.example.com.skills_utf8.R;
import com.video.VideoActivity1Fragment;
import com.video.VideoActivityFragment;

public class PicControlActivity extends BaseActivity implements View.OnClickListener{


    @Override
    protected int initPageLayoutID() {
        return R.layout.activity_pic_control;
    }

    @Override
    protected void initPageView() {

        Button btn_clip_pic = (Button)findViewById(R.id.btn_clip_pic);
        Button btn_gif = (Button)findViewById(R.id.btn_gif);

        btn_clip_pic.setOnClickListener(this);
        btn_gif.setOnClickListener(this);

    }

    @Override
    protected void initPageViewListener() {

    }

    @Override
    protected void initProcess(Bundle bundle) {

    }




    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub

        Fragment fragment = null;

        switch(v.getId()){
            case R.id.btn_clip_pic:
                Intent intent = new Intent(this, PicClipActivity.class);
                startActivity(intent);
                break;

            case R.id.btn_gif:
                fragment = new PicGIFFragment();
                break;


        }

        if(fragment != null){
            android.app.FragmentTransaction transaction = getFragmentManager().beginTransaction();
            transaction.replace(R.id.layout_content, fragment);
            transaction.commit();
        }



    }



}
